#include<stdio.h>

int gcd(int a,int b)
{
    while(b!=0)
    {
        int c = a%b;
        a = b;
        b = c;
    }
    return a;
}


int main()
{
    int a,b;
    int t;
    scanf("%d",&t);
    while(t)
    {
        scanf("%d%d",&a,&b);
        if(a==0||b==0)
        {
            printf("0\n");
            t--;
            continue;
        }
        int c = 2*a*b;
        int d = (a+b)*(a+b-1);
        int e = gcd(c,d);
        if(c/e==d/e)
        {
            printf("1\n");
        }
        else if(d/e==1)
        {
            printf("%d\n",c/e);
        }
        else
        {
            printf("%d/%d\n",c/e,d/e);
        }
        t--;
    }
    return 0;
}